﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SWF.Runtime
{
    public struct Vertex
    {
        //----------------------------------------------------------------------
        public Vector2 Position;
        public Vector4 Color;

        //----------------------------------------------------------------------
        public Vertex(Vector2 position, Color color)
        {
            Position = position;
            Color = color.ToVector4();
        }

        //----------------------------------------------------------------------
        public static readonly VertexElement[] VertexElements =
        {
            new VertexElement(0, VertexElementFormat.Vector2, VertexElementUsage.Position, 0),
            new VertexElement(8, VertexElementFormat.Vector4, VertexElementUsage.Color, 0),
        };

        //----------------------------------------------------------------------
        public const int SizeInBytes = 24;
    }
}
